package rhc.singleNodeSpider.spider.impl;

import rhc.singleNodeSpider.BasicComponent;
import rhc.singleNodeSpider.spider.SingleNodeSpider;
import rhc.spider.crawler.Crawler;

/**单节点爬虫实现
 * @author rhc
 *
 */
public class SingleNodeSpiderImpl extends BasicComponent implements SingleNodeSpider {

	/**
	 * 爬虫
	 */
	private Crawler crawler;
	
	public SingleNodeSpiderImpl(Crawler crawler){
		this.crawler=crawler;
	}
	
	@Override
	public void run() throws Exception {
		crawler.start();
	}

	@Override
	public void stop() throws Exception {
		crawler.stop();
	}

	@Override
	public void pause() throws Exception {
		crawler.pause();
	}

	@Override
	public void regain() throws Exception {
		crawler.regain();
	}

	@Override
	public void setCrawler(Crawler crawler) {
		this.crawler=crawler;
	}
	
}
